<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="_token" content="{{ csrf_token() }}"/>
    <title>@yield('title')</title>

    <link href="{{ asset('css/app.css') }}" rel="stylesheet">
    <link rel="stylesheet" href="{{ asset('css/base.css')}}" />
    <link rel="stylesheet" href="{{ asset('css/inputStyle.css')}}"/>
    <link rel="stylesheet" href="{{ asset('css/indexBo.css')}}">
    <link rel="stylesheet" type="text/css" href="{{ asset('css/demoList.css')}}" />
    <link href="{{ asset('css/uploadFile/font-awesome.css')}}" rel="stylesheet">
    <link href="{{ asset('css/uploadFile/animate.css')}}" rel="stylesheet">
    <link href="{{ asset('css/uploadFile/style.css')}}" rel="stylesheet">
@yield('css')
<!--必要样式-->
    <link rel="stylesheet" type="text/css" href="{{ asset('css/componentList.css')}}" />

    <script src="{{ asset('js/modernizr.custom.js')}}"></script>
    <style>
        .liInput{
            height: 45px;
            border-bottom-right-radius: 5px;
            border-top-right-radius: 5px;
            width: 20%;
        }

    </style>
</head>
<body style="overflow-y: scroll;background: rgba(129, 196, 57, 0.53);">

<!--导航条-->

<div class="nav" id="nav">
    <ul class="menu">
        <li><a href="{{ url('/')}}">首页</a>
            <ul class="submenu">

            </ul>
        </li>
        <li><a href="javascript:;">作品欣赏</a>
            <ul class="submenu jaws">
                <li><a href="{{ url('enjoy')}}">视觉享受</a></li>
            </ul>
        </li>
        <li><a href="javascript:;">作品分类</a>
            <ul class="submenu zipper">
                <li><a href="{{ url('art')}}?id=1">风光摄影</a></li>
                <li><a href="{{ url('art')}}?id=3">商业摄影</a></li>
                <li><a href="{{ url('art')}}?id=4">艺术摄影</a></li>
                <li><a href="{{ url('art')}}?id=5">微距摄影</a></li>
            </ul>
        </li>
        <li><a href="javascript:;">活动专区</a>
            <ul class="submenu fence">
                <li><a href="{{ url('/home/active')}}">进入活动专区</a></li>
            </ul>
        </li>
        <li>
            {{--<a href="javascript:;">个人中心</a>--}}
            {{--<ul class="submenu">--}}
            {{--<li><a href="javascript:;">options</a></li>--}}
            {{--<li><a href="javascript:;">options</a></li>--}}
            {{--<li><a href="javascript:;">options</a></li>--}}
            {{--</ul>--}}
            @if (!session('user'))
                <a href="javascript:;">未登录</a>
                <ul class="submenu zipper" role="menu">
                    <li><a href="{{ url('login') }}">登录</a> </li>
                    <li><a href="{{ url('register') }}">注册</a> </li>
                </ul>
            @else

                <a href="javascript:;">
                    {{ session('user')->name }} <img class="headPic" src="{{ asset('images/base/moren.jpg')}}">
                </a>

                <ul class="submenu zipper" role="menu">
                    <li><a href="{{ url('myZone')}}">个人中心</a></li>
                    <li>
                        <a href="{{ url('logout') }}"
                           ">
                            退出
                        </a>
                    </li>
                </ul>

            @endif

        </li>
        <li class="liInput" style="height: 49px;">
            <input class="inputXuan"  type="text" placeholder="你不输入一点什么吗？"/>
            <img class="search" src="{{asset('images/base/search.png')}}">
        </li>
    </ul>
</div>

@yield('content')




<script src="{{ asset('js/jquery-3.0.0.min.js')}}"></script>
<script src="{{ asset('js/bootstrap.min.js')}}"></script>
<script src="{{ asset('js/index.js')}}"></script>
<script src="{{ asset('js/inputSnow.js')}}"></script>
<script src="{{ asset('js/classie.js')}}"></script>
<script src="{{ asset('js/thumbnailGridEffects.js')}}"></script>
<script src="{{ asset('js/app.js') }}"></script>
<script>
    {{--搜索框--}}
    //搜索框
    $(".search").click(function () {
        var searchWord = $(".inputXuan").val();
        $.ajax({
            type: "POST",
            url: lll,
            data:{searchWord:searchWord},
            // dataType: "json",
            headers:{
                'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
            },
            success: function(msg){


            },
            error:function(data){
                console.log('错误');
            }
        });
    });
    {{--四个列表页的排序都是默认降序--}}
    $(".paixu p").click(function () {

        //获取Url的id
        var shareUrl =location.href;
        var did = shareUrl .substr(shareUrl .length-1);

        var upDown = $(this).find("img");
        var url = "";
        url = $(upDown).attr('src');

        var data = '';
        var order = '';

        // 点击变升序
        if(url.indexOf('down.png') >0){
            //修改路径
            url = url.replace(/down.png/, 'up.png');
            //替换路径
            $(upDown).attr('src', url);
            order = '1';
        }
        //变降序
        else if(url.indexOf('up.png') >0 ){
            //修改路径
            url = url.replace(/up.png/, 'down.png');
            //替换路径
            $(upDown).attr('src', url);
            order = '2';
        }

        var className = $(this).attr("class");
        data = className;
        //按照收藏次数排序count
        //按照时间顺序排序time
        $.ajax({
            type: "GET",
            url: "{{ url('home/art') }}",
            data: {data:data,id:did,sort:order},
            dataType: "json",
            headers:{
                'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
            },
            success: function(msg){
                $(".order").html(msg['1']);
            },
            error:function(data){
                console.log('bbbbb');
            }
        });


    });
</script>
@yield('js')

</body>
</html>